import { request } from '@umijs/max';

const { UMI_APP_SERVERURL_IP } = process.env;

/** 本系统内部登录 获取code 再验证账号密码登录 POST /api/login/account */
export async function getCodeSYS(body: any, options?: { [key: string]: any }) {
  return request<API.LoginCodeResult>(UMI_APP_SERVERURL_IP + '/code', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 本系统内部登录 验证账号密码登录 */
export async function signinSYS(params: any, options?: { [key: string]: any }) {
  return request<API.SigninResult>(UMI_APP_SERVERURL_IP + '/signin', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
